index.html.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <!-- 头部 -->
  3. <templateHead></templateHead>
  4. <!-- 菜单 -->
  5. <templateMenu></templateMenu>
  6. <div>
  7. <!-- 广告组件 -->
  8. <templateAd :adTag="'nmw_page_0001'" :skinId="skinId" :adData="adData"></templateAd>
  9. <!-- 底部详情-详情 -->
  10. <templateAboutDetail :skinId="skinId" :templateData="testTemplateData2"></templateAboutDetail>
  11. <!-- 广告组件 -->
  12. <templateAd :adTag="'nmw_page_0001'" :skinId="skinId" :adData="adData"></templateAd>
  13. </div>
  14. <!-- 底部 -->
  15. <templateFoot></templateFoot>
  16. </template>
  17. <script setup>
  18. //0.加载全局模板组件 start---------------------------------------->
  19. //0.1 全局通栏
  20. import templateHead from '@/components/template/sector/head/1200x200/1.vue'
  21. import templateMenu from '@/components/template/sector/menu/1200x130/1.vue'
  22. import templateFoot from '@/components/template/sector/foot/1200x580/1.vue'
  23. //0.2 局部通栏
  24. //0.2.1 广告组件
  25. import templateAd from '@/components/template/sector/body/ad/1200x90/1.vue'
  26. //0.2.2 底部详情-详情
  27. import templateAboutDetail from '@/components/template/sector/body/about/1200x1150/1.vue'
  28. //0.加载全局模板组件 end---------------------------------------->
  29. //1.获得基本信息单元 start---------------------------------------->
  30. //1.1获得页面依赖
  31. import { ref, onMounted } from 'vue';
  32. //1.2获得pinia源
  33. import { useTemplateBaseStore } from '@/stores/templateBase'
  34. const templateBaseStore = useTemplateBaseStore()
  35. //1.3获得该页的皮肤id - 在每个组件中也是同样的获得方法
  36. const skinId = ref("")
  37. const websiteId = ref("")
  38. //1.4获得站点基本信息
  39. const responseStatus = await requestDataPromise('/web/getWebsiteAllinfo', {
  40. method: 'GET',
  41. query: {
  42. 'link_textnum':24,
  43. 'link_imgnum':18,
  44. 'link_footnum':4
  45. },
  46. });
  47. if (responseStatus.code == 200) {
  48. //0.3.1设置站点基本信息
  49. templateBaseStore.setWebSiteInfo(responseStatus.data)
  50. websiteId.value = responseStatus.data.website_head.id;//获得网站id
  51. //0.3.2设置皮肤id
  52. skinId.value = templateBaseStore.webSiteInfo.website_foot.foot_info.template_id;
  53. console.log("当前的网站id:"+responseStatus.data.website_head.id)
  54. //0.3.3设置seo信息
  55. let seoTitle = templateBaseStore.webSiteInfo.website_head.title;
  56. let seoDescription = templateBaseStore.webSiteInfo.website_head.description;
  57. let seoKeywords = templateBaseStore.webSiteInfo.website_head.keywords;
  58. let seoSuffix = templateBaseStore.webSiteInfo.website_head.suffix;
  59. let seoName = templateBaseStore.webSiteInfo.website_head.website_name;
  60. useSeoMeta({
  61. title: seoTitle + "_" + seoSuffix,
  62. meta: [
  63. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  64. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  65. ]
  66. });
  67. }
  68. //1.5获得广告池
  69. const adData = ref([]);
  70. const adResponseStatus = await requestDataPromise('/web/getWebsiteAdvertisement', {
  71. method: 'GET',
  72. query: {},
  73. });
  74. if (adResponseStatus.code == 200) {
  75. adData.value = adResponseStatus.data;
  76. templateBaseStore.setAdList(adResponseStatus.data)
  77. }
  78. //1.获得基本信息单元 end---------------------------------------->
  79. //2.测试数据 start ---------------------------------------->
  80. //静态链接测试数据
  81. const testTemplateData2 = {
  82. "sectorName": "linkSector",
  83. "componentList": [
  84. {
  85. "component_type": 3,
  86. "component_style": 1,
  87. "sort": 1,
  88. "componentData": {}
  89. },
  90. {
  91. "component_type": 3,
  92. "component_style": 1,
  93. "sort": 1,
  94. "componentData": {}
  95. }
  96. ],
  97. "sort": 4
  98. }
  99. //2.测试数据 end ---------------------------------------->
  100. </script>
  101. <style lang="less" scoped>
  102. @import '@/assets/css/about.less';
  103. </style>